package cn.wh.context.support;

import cn.wh.beans.BeansException;

/**
 * @Author wanghao
 * @Date 2022-09-20 22:40
 * @Description: TODO
 */
public class ClassPathXmlApplicationContext  extends AbstractXmlApplicationContext {


    private String[] configLocations;

    public ClassPathXmlApplicationContext() {
    }

    public ClassPathXmlApplicationContext(String configLocations) throws BeansException {
        this(new String[]{configLocations});
    }


    /**
     * 从 XML 中加载 BeanDefinition，并刷新上下文
     * @param configLocations
     * @throws BeansException
     */
    public ClassPathXmlApplicationContext(String[] configLocations) throws BeansException {
        this.configLocations = configLocations;
        refresh();
    }



    @Override
    protected String[] getConfigLocations() {
        return configLocations;
    }
}
